<?php
session_start();
require '../nette/Nette/loader.php';
require '../db.php';
require '../localization/lang.php';
require '../core/core.sanitizer.php';
require '../core/core.security.php';
require '../core/core.dfs.php';
require '../visual/visual.dfs.php';

$login=new core_security;
if ($login->checklogin()=="OK" AND $_SESSION['role']<=1) {
$loc= new loc;
$newusers="";
$query="select users from tree where ID=".$_POST['ID']."";
$result=mysql_query($query);
$row=mysql_fetch_array($result);

$users=explode(",",$row['users']);
foreach ($users as $value) {
if ($value != $_POST['username'] AND $value != "") {$newusers=$newusers.",".$value;}
}

$query2="update tree set users='".$newusers."' WHERE ID=".$_POST['ID']."";
mysql_query($query2);

}
